# -*- coding: utf-8 -*-
__author__ = 'hftec'
import sys,os
sys.path.append(os.path.dirname(sys.path[0]))
import lcopa_scan
import thread_random_scan
if __name__ == '__main__':
    scan = lcopa_scan.LcopaScan ('./u-phi/DF2015-FA02.txt')
    try:
        while(True):
            cmd = raw_input("cmd: \r\n")
            thread_random = thread_random_scan.RandomScanThread()

            if(cmd == '1'):
                print "dec scans\r\n"
                scan.dec_scan(0.002,-0.002,0.00001)
            elif(cmd == '2'):
                print "inc scans\r\n"
                scan.inc_scan(0.002,-0.002,0.00001)
            elif(cmd == '3'):
                try:
                    print "ramdom scans\r\n"
                    thread_random.start()
                    #thread_random.join()
                    #scan.ramdom_scan(0.002,-0.002)
                except KeyboardInterrupt:
                    thread_random.stop()
    except KeyboardInterrupt:
        thread_random.stop()
        print "ccc\r\n"
